home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Utilities / Winter Shell 1.0d2 / Source / Libraries / ProgressLib / ProgressLib.h < prev   
Encoding:
C/C++ Source or Header  |  1993-12-21  |  2.1 KB  |  50 lines  |  [TEXT/KAHL]

  1. #pragma once
  2. #include <stddef.h>
  3. #include "EventLib.h"
  4.  
  5. /* items in the standard progress dialog */
  6. enum {
  7.     PROGRESS_USER = 1,
  8.     PROGRESS_STOP,
  9.     PROGRESS_TEXT
  10. };
  11.  
  12. /* the following are variables used while running a progress dialog, which
  13.     is a dialog run once every few ticks while a lengthy operation
  14.     is taking place. */
  15. typedef struct {
  16.     TicksType    start;        /* time when progress event loop was entered */
  17.     DialogPtr    dlg;            /* dialog informing user to wait */
  18.     Str255        str;            /* string to display in dialog */
  19.     Boolean        appdlg;        /* true if dialog was created by application,
  20.                                         so we shouldn't dispose of it */
  21.     Boolean        modal;        /* if true then using a modal dialog */
  22.     Boolean        canceled;    /* true if canceled operation */
  23.     Boolean        visible;        /* true if the progress dialog is visible */
  24.     size_t        maxcnt;        /* maximum number of times application expects
  25.                                         to execute the progress event loop; this
  26.                                         enables us to draw a progress indicator */
  27.     size_t        count;        /* number of times dialog has been executed;
  28.                                         this helps us draw the progress indicator */
  29.     short            useritm;        /* item number of progress indicator */
  30.     short            textitm;        /* item number of text item */
  31.     TicksType    lastRun;        /* last time ProgressRun executed */
  32.     TicksType    lastEvent;    /* last time we checked for events */
  33.     TicksType    lastCursor;    /* last time the cursor was changed */
  34.     TicksType    lastUpdate;    /* last time the dialog was updated */
  35.     TicksType    cursorInterval;/* interval to rotate cursor */
  36.     short            cursorIndex;/* index to rotating cursor */
  37. } ProgressType, *ProgressPtr, **ProgressHandle;
  38.  
  39. Boolean ProgressValid(ProgressHandle progress);
  40. void ProgressUpdate(ProgressHandle progress);
  41. void ProgressRun(ProgressHandle progress, long done);
  42. void ProgressOpenDialog(ProgressHandle progress, Boolean modal);
  43. void ProgressPrompt(ProgressHandle progress, const char *fmt, ...);
  44. void ProgressReset(ProgressHandle progress, size_t max);
  45. ProgressHandle ProgressBegin(size_t max, CStr255 str,
  46.     DialogPtr dlg, short useritm, short textitm);
  47. void ProgressEnd(ProgressHandle progress);
  48. const /* EventTableType */ void *ProgressEventTable(void);
  49. void ProgressEventTableRegister(void);
  50.